import java.util.Queue;

public class Test {
    private Queue<Integer> queue1;
    private Queue<Integer> queue2;
    public int pop() {
        Queue<Integer> tmp;
        if (queue1.isEmpty()){
            tmp = queue2;
        }
        int size = queue2.size();
        int i = 0;
        while(i<size-1){
           queue1.add(queue2.peek());
           queue2.poll();
           i++;
        }
        return queue2.peek();
    }

    public boolean isEmp() {
        return queue1.isEmpty() && queue2.isEmpty();
    }
}
